//-----------------------------------------------------------------------------
//
//
//-----------------------------------------------------------------------------
#ifndef	__EVENTS_ENGINE_H__
#define	__EVENTS_ENGINE_H__

	#include "MyTypes.h"  
	#include "Utility.h"
	#include "SystemEvents.h"
	void vfnEventsEngineInit(void);
	void vfnEventsEngine(void);


	typedef struct 
	{
		void (* const vfnpCB)(void);
		u32 wReloadValue;  
	}sPeriodicTimers;
	
    extern const sPeriodicTimers taPeriodicTimers[];
    
    void vfnPeriodicTimerEnable(u08 lbID);
    void vfnPeriodicTimerDisable(u08 lbID);
    void vfnTimeBasedEventsEngine(void);
	typedef struct
	{
	  void (* const vfnpCB)(void);
	}sEvent;
	extern u08 baEventFlags[];
	extern const sEvent taEvents[];
	extern const u08 gbaBitMasks[];
	
	
	#define FAST_EVENT_SET(EventID)     (baEventFlags[0]|=(1<<EventID))
	void vfnEventPost(u08 lbEventID);
	void vfnEventEnable(u08 lbEventID);
	void vfnEventDisable(u08 lbEventID);
#endif
